﻿using CDH_Shop.Models.Car;
using CDH_Shop.Models.Database;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CDH_Shop.Services
{
    public interface ICarService
    {
        /// <summary>
        /// 加入购物车方法
        /// </summary>
        /// <param name="goodId"></param>
        /// <returns></returns>
        bool AddCar(int goodId, int userId);
        /// <summary>
        /// 更新购物车数量
        /// </summary>
        /// <returns></returns>
        bool UpdateCar(Car car, int count);
        /// <summary>
        /// 删除购物车
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        bool DeleteCar(Car car);
        /// <summary>
        /// 根据用户Id和商品Id获取购物车对象
        /// </summary>
        /// <returns></returns>
        Car GetCarByUId(int goodId, int uId);
        /// <summary>
        /// 获取用的购物车商品列表
        /// </summary>
        /// <returns></returns>
        List<CarGood> GetCarList(int userId);

        /// <summary>
        /// 清空购物车 void空不需要返回值
        /// </summary>
        void ClearCar(int userId);
    }
}
